<template>
	<!-- 导航组件首页5专用 -->
	<view class="conter">
		<view>
			{{ title || '' }}
		</view>
		<u-icon color="#fff" size="24" @click="handleGoBack" class="left" name="arrow-left"></u-icon>
	</view>
</template>

<script>
//封装返回上一级组件路径
import { goBack } from '../../pages/utils/navigation.js';
export default {
	props: {
		title: String,
		payFlag: String, //payFlag=='1'跳转时之沙成功支付页面
		orderId: String,
		id: String
	},
	data() {
		return {
			flag: this.payFlag || '',
			newOrderId: this.orderId || '',
			newId: this.id
		};
	},
	methods: {
		//调用封装返回上一级
		handleGoBack() {
			if (this.flag == '1') {
				uni.redirectTo({
					url: '/pages/MarketOrder/timesOrderDetailsSucceess?orderId=' + this.newOrderId + '&id=' + this.newId
				});
			} else if (this.flag == '0') {
				uni.redirectTo({
					url: '/pages/MarketOrder/monSucces?orderId=' + this.newOrderId + '&id=' + this.newId
				});
			} else if (this.flag == '2') {
				uni.redirectTo({
					url: '/pages/MarketOrder/monOrderSucces?orderId=' + this.newOrderId + '&id=' + this.newId
				});
			} else if (this.flag == '3') {
				uni.redirectTo({
					url: '/pages/wallet/wallet'
				});
			} else if (this.flag == '4') {
				uni.redirectTo({
					url: '/pages/blackmarket/paymentSuccess?orderId=' + this.newOrderId //树的成功支付页面
				});
			} else {
				uni.navigateBack(1); // 调用uni.navigateBack()方法返回上一页
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.conter {
	width: 750rpx;
	height: 112rpx;
	background: #13151a;
	opacity: 1;
	position: relative;
	top: 0;
	view {
		font-size: 35rpx;

		font-family: 'font';
		font-weight: 800;
		color: #ffffff;
		text-align: center;
		line-height: 112rpx;
	}
	.left {
		position: absolute;
		top: 35rpx;
		left: 48.84rpx;
	}
}
</style>
